home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr01 / halcn305.zip / TUTOR02.PAS < prev    next >
Pascal/Delphi Source File  |  1993-04-21  |  1KB  |  39 lines

  1. program TUTOR02;
  2. {$N+,E+}          {Required for floating point number handling}
  3. uses
  4.    CRT,
  5.    GSOB_DBF,
  6.    GSOB_VAR;
  7. var
  8.    MyFile  : GSO_dBaseFld;
  9.    i       : integer;
  10.    s1,
  11.    s2      : string[30];
  12.  
  13. procedure WorkTheFile;            {reads the file, reverses LASTNAME, }
  14.                                   {displays fields, and writes the record}
  15. begin
  16.    MyFile.GetRec(Top_Record);     {Get the first record in the file}
  17.    while not MyFile.File_EOF do   {Repeat until end-of-file}
  18.    begin
  19.       s1 := MyFile.StringGet('LASTNAME');
  20.       s2 := '';
  21.       for i := 1 to length(s1) do s2 := s1[i] + s2;
  22.       Myfile.StringPut('LASTNAME',s2);
  23.       writeln(s2,', ',
  24.               MyFile.StringGet('FIRSTNAME'));
  25.       MyFile.PutRec(MyFile.RecNumber);
  26.       MyFile.GetRec(Next_Record); {Get the next sequential record}
  27.    end;
  28. end;
  29.  
  30. {------ Main Routine ------}
  31.  
  32. begin
  33.    ClrScr;
  34.    MyFile.Init('TUTOR1');
  35.    MyFile.Open;
  36.    WorkTheFile;
  37.    MyFile.Close;
  38. end.
  39.